from testinput import test_if_int2

n, retry = test_if_int2.test_if_int_function(input("请输入一个整数"))
Sum = 0
if retry:
    for num1 in range(1, n + 1):
        Sum1 = 1
        for num2 in range(1, num1 + 1):
            Sum1 *= num2
        Sum += Sum1
    print(f"1!+2!+......+n!={Sum}")
